
using System;
using System.Collections.Generic;
using System.Runtime.Serialization;
using System.Text;
using ProjectCommon2.Interfaces;


namespace PolePosition.v3.EntityLibrary
{
	// No comments for the class here, all are in Entity.cs.cst
    [DataContract(Namespace = "http://Chfa.DataContracts/2007/10", Name = "VendorDistributionPoleRemedy")]
	public sealed partial class VendorDistributionPoleRemedyEntity
		: Classes.Bases.Entity, ProjectCommon2.Interfaces.ICustomEntity	   
	{
		/// <summary>
		/// Determines if a default value (equivalent to the database's default value) is returned when the value of a <c>null</c> property is requested. 
		/// This makes sure that the stored checksum of a <c>VendorDistributionPoleRemedyEntity</c> with <c>null</c> properties matches the checksum calculated
		/// the next time it is loaded from the database.
		/// </summary>
		/// <remarks>
		/// <para>
		/// This variable exists to solve the checksum discrepancy that arises because the database replaces <c>null</c> values with its own default values
		/// (note that this is only relevant for those Entities for which verifying the checksum is important). An explanation follows.</para>
		///
		/// <para>A <c>VendorDistributionPoleRemedyEntity</c> can contain properties whose values are <c>null</c> (either because they have not been set, or because they were
		/// explicitly set that way). If a <c>VendorDistributionPoleRemedyEntity</c> is persisted to the database in that state, some of the <c>null</c> values will be replaced
		/// with default values by the database. However, before the Entity is persisted to the database, a checksum is calculated for its non-null values, and this
		/// checksum is stored in the database along with the rest of its values in order to validate it next time the Entity is loaded (see how the 
		/// <see cref="CheckSum" /> property works).
		/// </para>
		/// <para>Obviously, the original checksum calculated for an Entity with <c>null</c> properties will differ from the one calculated from its values
		/// the next time it is loaded from the database, since some of the null values were replaced by default values. Performing a checksum test on this Entity
		/// would raise a false <see cref="ProjectCommon2.Exceptions.EntityCheckSumSecurityException" />.
		/// </para>
		/// <para>To avoid this, <c>EnableDefaults</c> should be set to <c>true</c> for those Entities before persisting them to the database. If this is done,
		/// the Entity's column properties do not simply return <c>null</c> if its values are <c>null</c>. Instead, they return a value equivalent to the one the
		/// database would create for the <c>null</c> values (see the documentation for any of the column properties to see how they work). In this way, the
		/// Entity's original checksum, the one stored in the database, is created from the same values that will be used to calculate a checksum the next time 
		/// the Entity is loaded, thus eliminating the checksum discrepancy.
		/// </para>
		/// </remarks>
		public bool EnableDefaults;

		#region " Column Properties "
		
			
			
				
					// PoleFk
					/// <summary>
					/// Stores the value of the PoleFk column.
					/// </summary>
					/// <remarks><para>
					/// This is an instance of the <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> class, which is
					/// used by all column properties to hold the value assigned to them.
					/// A <c>PropertyHelper</c> object exposes a set of useful properties and behaviors that wouldn't be available if this were a simple 
					/// value-type variable. The properties are dynamic and are used to obtain information about the value contained in the object.
					/// See the <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> class for more.</para>
					/// <para>The object is not accessed directly by its corresponding public property (<c>PoleFk</c>),
					/// but through the <see cref="PoleFkObject" /> property. In this way,
					/// there is no need to create the object when the Entity is created, but only until it is needed.
					/// See the <see cref="PoleFkObject" /> or the <see cref="PoleFk" /> properties 
					/// for more.</para>
					/// </remarks>
					private ProjectCommon2.Helpers.PropertyHelper<int?> prop_PoleFk;
					
					/// <summary>
					/// Gets the helper object that stores the value of the PoleFk column.
					/// </summary>
					/// <remarks><para>
					/// This intermediary property creates the <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> object for 
					/// the PoleFk column property if it does not exist yet. It is used to avoid creating the object until it is
					/// needed. This results in a substantial performance gain for Entities with many column properties. See the 
					/// <see cref="prop_PoleFk" /> member or the <see cref="PoleFk" />
					/// property for more information about how they work together to provide access to an Entity's column value.
					/// </para></remarks>
					/// <value>Instance of <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> contained in 
					/// <see cref="prop_PoleFk" />.</value>
					[DataMember(), System.ComponentModel.Bindable(false), System.ComponentModel.Browsable(false)]
					public ProjectCommon2.Helpers.PropertyHelper<int?> PoleFkObject
					{
						get
						{
							if (prop_PoleFk == null)
							{
								prop_PoleFk = new ProjectCommon2.Helpers.PropertyHelper<int?>();
							}
							return prop_PoleFk;
						}
						private set
						{
							prop_PoleFk = value;
						}	
					}
					
					/// <summary>
					/// Gets or Sets the value of the PoleFk
					/// column.
					/// </summary>
					/// <remarks>
					/// <para>The Get accessor returns the current value assigned to this property, except when it is <c>null</c> (i.e., no value has been
					/// assigned). In that case, the value returned depends on the value of the Entity's <see cref="EnableDefaults" /> member. If it is <c>false</c>, the accessor
					/// simply returns <c>null</c>. However, when <see cref="EnableDefaults" /> is <c>true</c>, it returns the database's default value for the column that 
					/// corresponds to this property. To find out what the default value is, see the list of characteristics for the column at the end of this page. If there
					/// is no default value for the column, then <c>null</c> is returned. For more information about why this is done, see the documentation for 
					/// <see cref="EnableDefaults" />.
					/// </para>
					/// <para>When setting a value for this property, the Set accessor stores the given value in 
					/// <see cref="prop_PoleFk" /> (a helper object), but this property does not access it directly. Instead,
					/// it uses <see cref="PoleFkObject" />, which is a read-only property that returns a reference to the 
					/// <c>prop_PoleFk</c> helper object.
					/// </para>
					/// <para>In other words, there are two properties and one object for every column value that needs to be stored in the Entity. The intermediary read-only 
					/// property exists to make sure that the helper object is only instantiated when and if needed, which results in performance benefits for Entities with 
					/// many column properties.
					/// </para>
					/// PoleFk corresponds to the database column "tb_Vendor_Distribution_Pole_Remedy.PoleFk". The following are 
					/// characteristics of this column:
					/// <list type="bullet">
					/// <item>Length/Size: 4.</item>
					/// <item>Allows null:  Yes. </item>
					/// <item>Is primary key:  No. </item>
					/// <item>Is foreign key:  No. </item>
					/// <item>Is unique:  No  (does not reflect ad hoc unique indexes).</item>
					/// <item>Is identity:  No. </item>
					/// <item>Precision: 10.</item>
					/// <item>Scale: 0.</item>
					/// <item>System type: System.Int32.</item>
					/// <item>Default value:  None. </item>
					/// </list>
					/// </remarks>
					/// <value>Value stored in <see cref='prop_PoleFk' />.</value>
					[DataMember()]
					public int? PoleFk
					{
						get
						{
							if (EnableDefaults & PoleFkObject.IsNull)
							{
								return null;
							}
							return PoleFkObject.Value;
						}
						set
						{
							PoleFkObject.Value = value;
						}
					}
				
					// RemedyAssigned
					/// <summary>
					/// Stores the value of the RemedyAssigned column.
					/// </summary>
					/// <remarks><para>
					/// This is an instance of the <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> class, which is
					/// used by all column properties to hold the value assigned to them.
					/// A <c>PropertyHelper</c> object exposes a set of useful properties and behaviors that wouldn't be available if this were a simple 
					/// value-type variable. The properties are dynamic and are used to obtain information about the value contained in the object.
					/// See the <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> class for more.</para>
					/// <para>The object is not accessed directly by its corresponding public property (<c>RemedyAssigned</c>),
					/// but through the <see cref="RemedyAssignedObject" /> property. In this way,
					/// there is no need to create the object when the Entity is created, but only until it is needed.
					/// See the <see cref="RemedyAssignedObject" /> or the <see cref="RemedyAssigned" /> properties 
					/// for more.</para>
					/// </remarks>
					private ProjectCommon2.Helpers.PropertyHelper<string> prop_RemedyAssigned;
					
					/// <summary>
					/// Gets the helper object that stores the value of the RemedyAssigned column.
					/// </summary>
					/// <remarks><para>
					/// This intermediary property creates the <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> object for 
					/// the RemedyAssigned column property if it does not exist yet. It is used to avoid creating the object until it is
					/// needed. This results in a substantial performance gain for Entities with many column properties. See the 
					/// <see cref="prop_RemedyAssigned" /> member or the <see cref="RemedyAssigned" />
					/// property for more information about how they work together to provide access to an Entity's column value.
					/// </para></remarks>
					/// <value>Instance of <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> contained in 
					/// <see cref="prop_RemedyAssigned" />.</value>
					[DataMember(), System.ComponentModel.Bindable(false), System.ComponentModel.Browsable(false)]
					public ProjectCommon2.Helpers.PropertyHelper<string> RemedyAssignedObject
					{
						get
						{
							if (prop_RemedyAssigned == null)
							{
								prop_RemedyAssigned = new ProjectCommon2.Helpers.PropertyHelper<string>();
							}
							return prop_RemedyAssigned;
						}
						private set
						{
							prop_RemedyAssigned = value;
						}	
					}
					
					/// <summary>
					/// Gets or Sets the value of the RemedyAssigned
					/// column.
					/// </summary>
					/// <remarks>
					/// <para>The Get accessor returns the current value assigned to this property, except when it is <c>null</c> (i.e., no value has been
					/// assigned). In that case, the value returned depends on the value of the Entity's <see cref="EnableDefaults" /> member. If it is <c>false</c>, the accessor
					/// simply returns <c>null</c>. However, when <see cref="EnableDefaults" /> is <c>true</c>, it returns the database's default value for the column that 
					/// corresponds to this property. To find out what the default value is, see the list of characteristics for the column at the end of this page. If there
					/// is no default value for the column, then <c>null</c> is returned. For more information about why this is done, see the documentation for 
					/// <see cref="EnableDefaults" />.
					/// </para>
					/// <para>When setting a value for this property, the Set accessor stores the given value in 
					/// <see cref="prop_RemedyAssigned" /> (a helper object), but this property does not access it directly. Instead,
					/// it uses <see cref="RemedyAssignedObject" />, which is a read-only property that returns a reference to the 
					/// <c>prop_RemedyAssigned</c> helper object.
					/// </para>
					/// <para>In other words, there are two properties and one object for every column value that needs to be stored in the Entity. The intermediary read-only 
					/// property exists to make sure that the helper object is only instantiated when and if needed, which results in performance benefits for Entities with 
					/// many column properties.
					/// </para>
					/// RemedyAssigned corresponds to the database column "tb_Vendor_Distribution_Pole_Remedy.RemedyAssigned". The following are 
					/// characteristics of this column:
					/// <list type="bullet">
					/// <item>Length/Size: 150.</item>
					/// <item>Allows null:  Yes. </item>
					/// <item>Is primary key:  No. </item>
					/// <item>Is foreign key:  No. </item>
					/// <item>Is unique:  No  (does not reflect ad hoc unique indexes).</item>
					/// <item>Is identity:  No. </item>
					/// <item>Precision: 0.</item>
					/// <item>Scale: 0.</item>
					/// <item>System type: System.String.</item>
					/// <item>Default value:  None. </item>
					/// </list>
					/// </remarks>
					/// <value>Value stored in <see cref='prop_RemedyAssigned' />.</value>
					[DataMember()]
					public string RemedyAssigned
					{
						get
						{
							if (EnableDefaults & RemedyAssignedObject.IsNull)
							{
								return null;
							}
							return RemedyAssignedObject.Value;
						}
						set
						{
							RemedyAssignedObject.Value = value;
						}
					}
				
					// RemedyId
					/// <summary>
					/// Stores the value of the RemedyId column.
					/// </summary>
					/// <remarks><para>
					/// This is an instance of the <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> class, which is
					/// used by all column properties to hold the value assigned to them.
					/// A <c>PropertyHelper</c> object exposes a set of useful properties and behaviors that wouldn't be available if this were a simple 
					/// value-type variable. The properties are dynamic and are used to obtain information about the value contained in the object.
					/// See the <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> class for more.</para>
					/// <para>The object is not accessed directly by its corresponding public property (<c>RemedyId</c>),
					/// but through the <see cref="RemedyIdObject" /> property. In this way,
					/// there is no need to create the object when the Entity is created, but only until it is needed.
					/// See the <see cref="RemedyIdObject" /> or the <see cref="RemedyId" /> properties 
					/// for more.</para>
					/// </remarks>
					private ProjectCommon2.Helpers.PropertyHelper<int?> prop_RemedyId;
					
					/// <summary>
					/// Gets the helper object that stores the value of the RemedyId column.
					/// </summary>
					/// <remarks><para>
					/// This intermediary property creates the <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> object for 
					/// the RemedyId column property if it does not exist yet. It is used to avoid creating the object until it is
					/// needed. This results in a substantial performance gain for Entities with many column properties. See the 
					/// <see cref="prop_RemedyId" /> member or the <see cref="RemedyId" />
					/// property for more information about how they work together to provide access to an Entity's column value.
					/// </para></remarks>
					/// <value>Instance of <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> contained in 
					/// <see cref="prop_RemedyId" />.</value>
					[DataMember(), System.ComponentModel.Bindable(false), System.ComponentModel.Browsable(false)]
					public ProjectCommon2.Helpers.PropertyHelper<int?> RemedyIdObject
					{
						get
						{
							if (prop_RemedyId == null)
							{
								prop_RemedyId = new ProjectCommon2.Helpers.PropertyHelper<int?>();
							}
							return prop_RemedyId;
						}
						private set
						{
							prop_RemedyId = value;
						}	
					}
					
					/// <summary>
					/// Gets or Sets the value of the RemedyId
					/// column, which is (part of) the Primary Key of the VendorDistributionPoleRemedy table.
					/// </summary>
					/// <remarks>
					/// <para>The Get accessor returns the current value assigned to this property, except when it is <c>null</c> (i.e., no value has been
					/// assigned). In that case, the value returned depends on the value of the Entity's <see cref="EnableDefaults" /> member. If it is <c>false</c>, the accessor
					/// simply returns <c>null</c>. However, when <see cref="EnableDefaults" /> is <c>true</c>, it returns the database's default value for the column that 
					/// corresponds to this property. To find out what the default value is, see the list of characteristics for the column at the end of this page. If there
					/// is no default value for the column, then <c>null</c> is returned. For more information about why this is done, see the documentation for 
					/// <see cref="EnableDefaults" />.
					/// </para>
					/// <para>When setting a value for this property, the Set accessor stores the given value in 
					/// <see cref="prop_RemedyId" /> (a helper object), but this property does not access it directly. Instead,
					/// it uses <see cref="RemedyIdObject" />, which is a read-only property that returns a reference to the 
					/// <c>prop_RemedyId</c> helper object.
					/// </para>
					/// <para>In other words, there are two properties and one object for every column value that needs to be stored in the Entity. The intermediary read-only 
					/// property exists to make sure that the helper object is only instantiated when and if needed, which results in performance benefits for Entities with 
					/// many column properties.
					/// </para>
					/// RemedyId corresponds to the database column "tb_Vendor_Distribution_Pole_Remedy.RemedyId". The following are 
					/// characteristics of this column:
					/// <list type="bullet">
					/// <item>Length/Size: 4.</item>
					/// <item>Allows null:  No. </item>
					/// <item>Is primary key:  Yes. </item>
					/// <item>Is foreign key:  No. </item>
					/// <item>Is unique:  Yes  (does not reflect ad hoc unique indexes).</item>
					/// <item>Is identity:  Yes. </item>
					/// <item>Precision: 10.</item>
					/// <item>Scale: 0.</item>
					/// <item>System type: System.Int32.</item>
					/// <item>Default value:  None. </item>
					/// </list>
					/// </remarks>
					/// <value>Value stored in <see cref='prop_RemedyId' />.</value>
					[DataMember()]
					public int? RemedyId
					{
						get
						{
							if (EnableDefaults & RemedyIdObject.IsNull)
							{
								return null;
							}
							return RemedyIdObject.Value;
						}
						set
						{
							RemedyIdObject.Value = value;
						}
					}
				
					// RemedyLastAction
					/// <summary>
					/// Stores the value of the RemedyLastAction column.
					/// </summary>
					/// <remarks><para>
					/// This is an instance of the <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> class, which is
					/// used by all column properties to hold the value assigned to them.
					/// A <c>PropertyHelper</c> object exposes a set of useful properties and behaviors that wouldn't be available if this were a simple 
					/// value-type variable. The properties are dynamic and are used to obtain information about the value contained in the object.
					/// See the <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> class for more.</para>
					/// <para>The object is not accessed directly by its corresponding public property (<c>RemedyLastAction</c>),
					/// but through the <see cref="RemedyLastActionObject" /> property. In this way,
					/// there is no need to create the object when the Entity is created, but only until it is needed.
					/// See the <see cref="RemedyLastActionObject" /> or the <see cref="RemedyLastAction" /> properties 
					/// for more.</para>
					/// </remarks>
					private ProjectCommon2.Helpers.PropertyHelper<DateTime?> prop_RemedyLastAction;
					
					/// <summary>
					/// Gets the helper object that stores the value of the RemedyLastAction column.
					/// </summary>
					/// <remarks><para>
					/// This intermediary property creates the <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> object for 
					/// the RemedyLastAction column property if it does not exist yet. It is used to avoid creating the object until it is
					/// needed. This results in a substantial performance gain for Entities with many column properties. See the 
					/// <see cref="prop_RemedyLastAction" /> member or the <see cref="RemedyLastAction" />
					/// property for more information about how they work together to provide access to an Entity's column value.
					/// </para></remarks>
					/// <value>Instance of <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> contained in 
					/// <see cref="prop_RemedyLastAction" />.</value>
					[DataMember(), System.ComponentModel.Bindable(false), System.ComponentModel.Browsable(false)]
					public ProjectCommon2.Helpers.PropertyHelper<DateTime?> RemedyLastActionObject
					{
						get
						{
							if (prop_RemedyLastAction == null)
							{
								prop_RemedyLastAction = new ProjectCommon2.Helpers.PropertyHelper<DateTime?>();
							}
							return prop_RemedyLastAction;
						}
						private set
						{
							prop_RemedyLastAction = value;
						}	
					}
					
					/// <summary>
					/// Gets or Sets the value of the RemedyLastAction
					/// column.
					/// </summary>
					/// <remarks>
					/// <para>The Get accessor returns the current value assigned to this property, except when it is <c>null</c> (i.e., no value has been
					/// assigned). In that case, the value returned depends on the value of the Entity's <see cref="EnableDefaults" /> member. If it is <c>false</c>, the accessor
					/// simply returns <c>null</c>. However, when <see cref="EnableDefaults" /> is <c>true</c>, it returns the database's default value for the column that 
					/// corresponds to this property. To find out what the default value is, see the list of characteristics for the column at the end of this page. If there
					/// is no default value for the column, then <c>null</c> is returned. For more information about why this is done, see the documentation for 
					/// <see cref="EnableDefaults" />.
					/// </para>
					/// <para>When setting a value for this property, the Set accessor stores the given value in 
					/// <see cref="prop_RemedyLastAction" /> (a helper object), but this property does not access it directly. Instead,
					/// it uses <see cref="RemedyLastActionObject" />, which is a read-only property that returns a reference to the 
					/// <c>prop_RemedyLastAction</c> helper object.
					/// </para>
					/// <para>In other words, there are two properties and one object for every column value that needs to be stored in the Entity. The intermediary read-only 
					/// property exists to make sure that the helper object is only instantiated when and if needed, which results in performance benefits for Entities with 
					/// many column properties.
					/// </para>
					/// RemedyLastAction corresponds to the database column "tb_Vendor_Distribution_Pole_Remedy.RemedyLastAction". The following are 
					/// characteristics of this column:
					/// <list type="bullet">
					/// <item>Length/Size: 8.</item>
					/// <item>Allows null:  Yes. </item>
					/// <item>Is primary key:  No. </item>
					/// <item>Is foreign key:  No. </item>
					/// <item>Is unique:  No  (does not reflect ad hoc unique indexes).</item>
					/// <item>Is identity:  No. </item>
					/// <item>Precision: 23.</item>
					/// <item>Scale: 3.</item>
					/// <item>System type: System.DateTime.</item>
					/// <item>Default value:  None. </item>
					/// </list>
					/// </remarks>
					/// <value>Value stored in <see cref='prop_RemedyLastAction' />.</value>
					[DataMember()]
					public DateTime? RemedyLastAction
					{
						get
						{
							if (EnableDefaults & RemedyLastActionObject.IsNull)
							{
								return null;
							}
							return RemedyLastActionObject.Value;
						}
						set
						{
							RemedyLastActionObject.Value = value;
						}
					}
				
					// RemedyNotes
					/// <summary>
					/// Stores the value of the RemedyNotes column.
					/// </summary>
					/// <remarks><para>
					/// This is an instance of the <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> class, which is
					/// used by all column properties to hold the value assigned to them.
					/// A <c>PropertyHelper</c> object exposes a set of useful properties and behaviors that wouldn't be available if this were a simple 
					/// value-type variable. The properties are dynamic and are used to obtain information about the value contained in the object.
					/// See the <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> class for more.</para>
					/// <para>The object is not accessed directly by its corresponding public property (<c>RemedyNotes</c>),
					/// but through the <see cref="RemedyNotesObject" /> property. In this way,
					/// there is no need to create the object when the Entity is created, but only until it is needed.
					/// See the <see cref="RemedyNotesObject" /> or the <see cref="RemedyNotes" /> properties 
					/// for more.</para>
					/// </remarks>
					private ProjectCommon2.Helpers.PropertyHelper<string> prop_RemedyNotes;
					
					/// <summary>
					/// Gets the helper object that stores the value of the RemedyNotes column.
					/// </summary>
					/// <remarks><para>
					/// This intermediary property creates the <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> object for 
					/// the RemedyNotes column property if it does not exist yet. It is used to avoid creating the object until it is
					/// needed. This results in a substantial performance gain for Entities with many column properties. See the 
					/// <see cref="prop_RemedyNotes" /> member or the <see cref="RemedyNotes" />
					/// property for more information about how they work together to provide access to an Entity's column value.
					/// </para></remarks>
					/// <value>Instance of <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> contained in 
					/// <see cref="prop_RemedyNotes" />.</value>
					[DataMember(), System.ComponentModel.Bindable(false), System.ComponentModel.Browsable(false)]
					public ProjectCommon2.Helpers.PropertyHelper<string> RemedyNotesObject
					{
						get
						{
							if (prop_RemedyNotes == null)
							{
								prop_RemedyNotes = new ProjectCommon2.Helpers.PropertyHelper<string>();
							}
							return prop_RemedyNotes;
						}
						private set
						{
							prop_RemedyNotes = value;
						}	
					}
					
					/// <summary>
					/// Gets or Sets the value of the RemedyNotes
					/// column.
					/// </summary>
					/// <remarks>
					/// <para>The Get accessor returns the current value assigned to this property, except when it is <c>null</c> (i.e., no value has been
					/// assigned). In that case, the value returned depends on the value of the Entity's <see cref="EnableDefaults" /> member. If it is <c>false</c>, the accessor
					/// simply returns <c>null</c>. However, when <see cref="EnableDefaults" /> is <c>true</c>, it returns the database's default value for the column that 
					/// corresponds to this property. To find out what the default value is, see the list of characteristics for the column at the end of this page. If there
					/// is no default value for the column, then <c>null</c> is returned. For more information about why this is done, see the documentation for 
					/// <see cref="EnableDefaults" />.
					/// </para>
					/// <para>When setting a value for this property, the Set accessor stores the given value in 
					/// <see cref="prop_RemedyNotes" /> (a helper object), but this property does not access it directly. Instead,
					/// it uses <see cref="RemedyNotesObject" />, which is a read-only property that returns a reference to the 
					/// <c>prop_RemedyNotes</c> helper object.
					/// </para>
					/// <para>In other words, there are two properties and one object for every column value that needs to be stored in the Entity. The intermediary read-only 
					/// property exists to make sure that the helper object is only instantiated when and if needed, which results in performance benefits for Entities with 
					/// many column properties.
					/// </para>
					/// RemedyNotes corresponds to the database column "tb_Vendor_Distribution_Pole_Remedy.RemedyNotes". The following are 
					/// characteristics of this column:
					/// <list type="bullet">
					/// <item>Length/Size: -1.</item>
					/// <item>Allows null:  Yes. </item>
					/// <item>Is primary key:  No. </item>
					/// <item>Is foreign key:  No. </item>
					/// <item>Is unique:  No  (does not reflect ad hoc unique indexes).</item>
					/// <item>Is identity:  No. </item>
					/// <item>Precision: 0.</item>
					/// <item>Scale: 0.</item>
					/// <item>System type: System.String.</item>
					/// <item>Default value:  None. </item>
					/// </list>
					/// </remarks>
					/// <value>Value stored in <see cref='prop_RemedyNotes' />.</value>
					[DataMember()]
					public string RemedyNotes
					{
						get
						{
							if (EnableDefaults & RemedyNotesObject.IsNull)
							{
								return null;
							}
							return RemedyNotesObject.Value;
						}
						set
						{
							RemedyNotesObject.Value = value;
						}
					}
				
					// RemedyResolvedDate
					/// <summary>
					/// Stores the value of the RemedyResolvedDate column.
					/// </summary>
					/// <remarks><para>
					/// This is an instance of the <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> class, which is
					/// used by all column properties to hold the value assigned to them.
					/// A <c>PropertyHelper</c> object exposes a set of useful properties and behaviors that wouldn't be available if this were a simple 
					/// value-type variable. The properties are dynamic and are used to obtain information about the value contained in the object.
					/// See the <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> class for more.</para>
					/// <para>The object is not accessed directly by its corresponding public property (<c>RemedyResolvedDate</c>),
					/// but through the <see cref="RemedyResolvedDateObject" /> property. In this way,
					/// there is no need to create the object when the Entity is created, but only until it is needed.
					/// See the <see cref="RemedyResolvedDateObject" /> or the <see cref="RemedyResolvedDate" /> properties 
					/// for more.</para>
					/// </remarks>
					private ProjectCommon2.Helpers.PropertyHelper<DateTime?> prop_RemedyResolvedDate;
					
					/// <summary>
					/// Gets the helper object that stores the value of the RemedyResolvedDate column.
					/// </summary>
					/// <remarks><para>
					/// This intermediary property creates the <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> object for 
					/// the RemedyResolvedDate column property if it does not exist yet. It is used to avoid creating the object until it is
					/// needed. This results in a substantial performance gain for Entities with many column properties. See the 
					/// <see cref="prop_RemedyResolvedDate" /> member or the <see cref="RemedyResolvedDate" />
					/// property for more information about how they work together to provide access to an Entity's column value.
					/// </para></remarks>
					/// <value>Instance of <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> contained in 
					/// <see cref="prop_RemedyResolvedDate" />.</value>
					[DataMember(), System.ComponentModel.Bindable(false), System.ComponentModel.Browsable(false)]
					public ProjectCommon2.Helpers.PropertyHelper<DateTime?> RemedyResolvedDateObject
					{
						get
						{
							if (prop_RemedyResolvedDate == null)
							{
								prop_RemedyResolvedDate = new ProjectCommon2.Helpers.PropertyHelper<DateTime?>();
							}
							return prop_RemedyResolvedDate;
						}
						private set
						{
							prop_RemedyResolvedDate = value;
						}	
					}
					
					/// <summary>
					/// Gets or Sets the value of the RemedyResolvedDate
					/// column.
					/// </summary>
					/// <remarks>
					/// <para>The Get accessor returns the current value assigned to this property, except when it is <c>null</c> (i.e., no value has been
					/// assigned). In that case, the value returned depends on the value of the Entity's <see cref="EnableDefaults" /> member. If it is <c>false</c>, the accessor
					/// simply returns <c>null</c>. However, when <see cref="EnableDefaults" /> is <c>true</c>, it returns the database's default value for the column that 
					/// corresponds to this property. To find out what the default value is, see the list of characteristics for the column at the end of this page. If there
					/// is no default value for the column, then <c>null</c> is returned. For more information about why this is done, see the documentation for 
					/// <see cref="EnableDefaults" />.
					/// </para>
					/// <para>When setting a value for this property, the Set accessor stores the given value in 
					/// <see cref="prop_RemedyResolvedDate" /> (a helper object), but this property does not access it directly. Instead,
					/// it uses <see cref="RemedyResolvedDateObject" />, which is a read-only property that returns a reference to the 
					/// <c>prop_RemedyResolvedDate</c> helper object.
					/// </para>
					/// <para>In other words, there are two properties and one object for every column value that needs to be stored in the Entity. The intermediary read-only 
					/// property exists to make sure that the helper object is only instantiated when and if needed, which results in performance benefits for Entities with 
					/// many column properties.
					/// </para>
					/// RemedyResolvedDate corresponds to the database column "tb_Vendor_Distribution_Pole_Remedy.RemedyResolvedDate". The following are 
					/// characteristics of this column:
					/// <list type="bullet">
					/// <item>Length/Size: 8.</item>
					/// <item>Allows null:  Yes. </item>
					/// <item>Is primary key:  No. </item>
					/// <item>Is foreign key:  No. </item>
					/// <item>Is unique:  No  (does not reflect ad hoc unique indexes).</item>
					/// <item>Is identity:  No. </item>
					/// <item>Precision: 23.</item>
					/// <item>Scale: 3.</item>
					/// <item>System type: System.DateTime.</item>
					/// <item>Default value:  None. </item>
					/// </list>
					/// </remarks>
					/// <value>Value stored in <see cref='prop_RemedyResolvedDate' />.</value>
					[DataMember()]
					public DateTime? RemedyResolvedDate
					{
						get
						{
							if (EnableDefaults & RemedyResolvedDateObject.IsNull)
							{
								return null;
							}
							return RemedyResolvedDateObject.Value;
						}
						set
						{
							RemedyResolvedDateObject.Value = value;
						}
					}
				
					// RemedyStatusFK
					/// <summary>
					/// Stores the value of the RemedyStatusFK column.
					/// </summary>
					/// <remarks><para>
					/// This is an instance of the <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> class, which is
					/// used by all column properties to hold the value assigned to them.
					/// A <c>PropertyHelper</c> object exposes a set of useful properties and behaviors that wouldn't be available if this were a simple 
					/// value-type variable. The properties are dynamic and are used to obtain information about the value contained in the object.
					/// See the <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> class for more.</para>
					/// <para>The object is not accessed directly by its corresponding public property (<c>RemedyStatusFK</c>),
					/// but through the <see cref="RemedyStatusFKObject" /> property. In this way,
					/// there is no need to create the object when the Entity is created, but only until it is needed.
					/// See the <see cref="RemedyStatusFKObject" /> or the <see cref="RemedyStatusFK" /> properties 
					/// for more.</para>
					/// </remarks>
					private ProjectCommon2.Helpers.PropertyHelper<int?> prop_RemedyStatusFK;
					
					/// <summary>
					/// Gets the helper object that stores the value of the RemedyStatusFK column.
					/// </summary>
					/// <remarks><para>
					/// This intermediary property creates the <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> object for 
					/// the RemedyStatusFK column property if it does not exist yet. It is used to avoid creating the object until it is
					/// needed. This results in a substantial performance gain for Entities with many column properties. See the 
					/// <see cref="prop_RemedyStatusFK" /> member or the <see cref="RemedyStatusFK" />
					/// property for more information about how they work together to provide access to an Entity's column value.
					/// </para></remarks>
					/// <value>Instance of <see cref="ProjectCommon2.Helpers.PropertyHelper&lt;PropertyDataType&gt;" /> contained in 
					/// <see cref="prop_RemedyStatusFK" />.</value>
					[DataMember(), System.ComponentModel.Bindable(false), System.ComponentModel.Browsable(false)]
					public ProjectCommon2.Helpers.PropertyHelper<int?> RemedyStatusFKObject
					{
						get
						{
							if (prop_RemedyStatusFK == null)
							{
								prop_RemedyStatusFK = new ProjectCommon2.Helpers.PropertyHelper<int?>();
							}
							return prop_RemedyStatusFK;
						}
						private set
						{
							prop_RemedyStatusFK = value;
						}	
					}
					
					/// <summary>
					/// Gets or Sets the value of the RemedyStatusFK
					/// column.
					/// </summary>
					/// <remarks>
					/// <para>The Get accessor returns the current value assigned to this property, except when it is <c>null</c> (i.e., no value has been
					/// assigned). In that case, the value returned depends on the value of the Entity's <see cref="EnableDefaults" /> member. If it is <c>false</c>, the accessor
					/// simply returns <c>null</c>. However, when <see cref="EnableDefaults" /> is <c>true</c>, it returns the database's default value for the column that 
					/// corresponds to this property. To find out what the default value is, see the list of characteristics for the column at the end of this page. If there
					/// is no default value for the column, then <c>null</c> is returned. For more information about why this is done, see the documentation for 
					/// <see cref="EnableDefaults" />.
					/// </para>
					/// <para>When setting a value for this property, the Set accessor stores the given value in 
					/// <see cref="prop_RemedyStatusFK" /> (a helper object), but this property does not access it directly. Instead,
					/// it uses <see cref="RemedyStatusFKObject" />, which is a read-only property that returns a reference to the 
					/// <c>prop_RemedyStatusFK</c> helper object.
					/// </para>
					/// <para>In other words, there are two properties and one object for every column value that needs to be stored in the Entity. The intermediary read-only 
					/// property exists to make sure that the helper object is only instantiated when and if needed, which results in performance benefits for Entities with 
					/// many column properties.
					/// </para>
					/// RemedyStatusFK corresponds to the database column "tb_Vendor_Distribution_Pole_Remedy.RemedyStatusFK". The following are 
					/// characteristics of this column:
					/// <list type="bullet">
					/// <item>Length/Size: 4.</item>
					/// <item>Allows null:  Yes. </item>
					/// <item>Is primary key:  No. </item>
					/// <item>Is foreign key:  No. </item>
					/// <item>Is unique:  No  (does not reflect ad hoc unique indexes).</item>
					/// <item>Is identity:  No. </item>
					/// <item>Precision: 10.</item>
					/// <item>Scale: 0.</item>
					/// <item>System type: System.Int32.</item>
					/// <item>Default value:  None. </item>
					/// </list>
					/// </remarks>
					/// <value>Value stored in <see cref='prop_RemedyStatusFK' />.</value>
					[DataMember()]
					public int? RemedyStatusFK
					{
						get
						{
							if (EnableDefaults & RemedyStatusFKObject.IsNull)
							{
								return null;
							}
							return RemedyStatusFKObject.Value;
						}
						set
						{
							RemedyStatusFKObject.Value = value;
						}
					}

			// Special: FriendlyName
			/// <summary>
			///	Stores the value of the FriendlyName column.
			/// </summary>
			/// <value>Human-readable form of <c>VendorDistributionPoleRemedyEntity</c>'s name.</value>
			private string prop_FriendlyName;

			/// <summary>
			/// Gets or Sets a value that contains a more descriptive, human-readable form of <c>VendorDistributionPoleRemedyEntity</c>'s name.
			/// </summary>
			/// <value>Human-readable form of <c>VendorDistributionPoleRemedyEntity</c>'s name.</value>
			/// <remarks>Although <c>Set</c> is available, this value is never written back to the database. It is 
			/// made up from other columns in the database by the stored procedure that retrieves <c>VendorDistributionPoleRemedyEntity</c>'s
			/// record from the database.</remarks>
			[DataMember()]
			public string FriendlyName
			{
				get
				{
					return prop_FriendlyName;
				}
				set
				{
					prop_FriendlyName = value;
				}
			}
			
		#endregion

		#region " Other Properties "
		
		/// <summary>
		/// Stores a manually set value that indicates if <c>VendorDistributionPoleRemedyEntity</c>'s data is new.
		/// </summary>
		/// <remarks>
		/// Normally, this field should stay <c>null</c> to let <see cref="IsNew" />'s logic
		/// decide whether to return <c>true</c> or <c>false</c>.
		/// </remarks>
		private bool? prop_IsNew;
		
		/// <summary>
		/// Gets or Sets a value that specifies whether <c>VendorDistributionPoleRemedyEntity</c> contains new VendorDistributionPoleRemedy data
		/// or data loaded from an existing VendorDistributionPoleRemedy record.
		/// <para> </para>
		/// <c>True</c> if the data is new; <c>false</c> if it is from an existing record.
		/// </summary>
		/// <remarks>
		/// <para>Provided that its associated field (<see cref="prop_IsNew" />) stays <c>null</c>, this property returns
		/// <c>true</c> if no Primary Key value exists for <c>VendorDistributionPoleRemedyEntity</c>; false if there is one. This determines
		/// if a persist command (calling VendorDistributionPoleRemedyFactory's <c>Save()</c> method) will cause an <c>INSERT</c> or an
		/// <c>UPDATE</c> in the database. For more information, see how
		/// <see cref="Classes.Factories.VendorDistributionPoleRemedyFactory.Save(Classes.Entities.VendorDistributionPoleRemedyEntity, bool)" /> works.
		/// </para>
		/// <para>Note that manually setting this property's value to something other than <c>null</c> will bypass its logic,
		/// and it will return whatever value it is set to, even if it is incorrect.</para>
		/// </remarks>
		/// <value>Indicates if <c>VendorDistributionPoleRemedyEntity</c>'s data is new. Can be set to <c>true</c> (to indicate new data), <c>false</c>, 
		/// or <c>null</c>.</value>
		[DataMember(), System.ComponentModel.Bindable(false), System.ComponentModel.Browsable(false)]
		public bool? IsNew
		{
			get
			{
				// support manually overriding the IsNew value
				if (prop_IsNew != null)
				{
                    return prop_IsNew;
				}
                // Check IsDirty of key only
                return (this.RemedyIdObject.IsNull);
			}
			set
			{
				// manually override IsNew
				prop_IsNew = value;
			}
		}
		
		/// <summary>
		/// Stores a value that indicates whether <c>VendorDistributionPoleRemedyEntity</c> has been modified.
		/// </summary>
		/// <remarks>
		/// Normally, this field should stay <c>null</c> to let <see cref="IsDirty" />'s logic
		/// decide whether to return <c>true</c> or <c>false</c>.
		/// </remarks>
		private bool? prop_IsDirty;
		
		/// <summary>
		/// Gets a value that specifies whether <c>VendorDistributionPoleRemedyEntity</c>'s data has been modified since it was first loaded, or
		/// since the last time its <c>AcceptChanges()</c> method was called.
		/// <para> </para>
		/// <c>True</c> if the Entity has changed; <c>false</c> if it has not.
		/// </summary>
		/// <remarks>
		/// <para>Provided that its associated field (<see cref="prop_IsDirty" />) stays <c>null</c>, it returns <c>true</c> if
		/// the Entity's <see cref="IsNew" /> or <see cref="IsMarkedToDelete" /> properties are <c>true</c>. If none of them is, 
		/// it will check whether its <see cref="CheckSum" /> has changed and return an appropiate value based on the result of 
		/// that check.</para>
		/// <para>The value returned by <c>IsDirty</c> determines if a persist command (calling VendorDistributionPoleRemedyFactory's <c>Save()</c>)
		/// will <c>UPDATE</c> the corresponding record in the database. For more information, see how
		/// <see cref="Classes.Factories.VendorDistributionPoleRemedyFactory.Save(Classes.Entities.VendorDistributionPoleRemedyEntity, bool)" /> works.
		/// </para>
		/// <para>Note that manually setting this property's value to something other than <c>null</c> will bypass its logic,
		/// and it will return whatever value it is set to, even if it is incorrect.</para>
		/// </remarks>
		/// <value><c>Indicates if VendorDistributionPoleRemedyEntity</c> has been modified. <c>True</c> if it has; <c>false</c> otherwise.</value>
		[DataMember(), System.ComponentModel.Bindable(false), System.ComponentModel.Browsable(false)]
		public bool? IsDirty
		{
			get
			{
				
				// support manually overriding the IsDirty value
				if (prop_IsDirty != null)
				{
                    return prop_IsDirty;
				}

				if (IsNew == true)
					return true;
					
				if (IsMarkedToDelete == true)
					return true;
				
				if (CheckSumOriginal != CheckSum)
					return true;
					
				return RecurseBooleanProperty(this, "IsDirty");
			}
			private set
			{
				//only set the variable if manually set. Set is only available for serialization and should
				//only be used for reconstruction by deserialization.
				if (m_IsDirtyManuallySet)
					prop_IsDirty = value;
			}
		}
		
		//private variable supplied for deserialization, so that if the IsDirty was set manually the
		//prop_IsDirty can be set on reconstruction
		private bool m_IsDirtyManuallySet;
		
		/// <summary>
		/// Sets a value that indicates whether <c>VendorDistributionPoleRemedyEntity</c> has changed.
		/// <para> </para>
		/// Use <c>true</c> if the Entity has changed, <c>false</c> if not, or <c>null</c> to let
		/// the <see cref="IsDirty" /> property determine an appropiate value.
		/// </summary>
		/// <remarks>If set to something other than <c>null</c>, this overrides the <see cref="IsDirty" /> property's logic so that it will return the assigned
		/// value even if it is incorrect.</remarks>
		/// <value><c>Indicates if VendorDistributionPoleRemedyEntity</c> has been modified. <c>True</c> if it has; <c>false</c> otherwise.</value>
		public void SetManualIsDirty(bool? value)
		{
			// manually override IsDirty
			prop_IsDirty = value;
			
			if (value == null)
				m_IsDirtyManuallySet = false;
			else
				m_IsDirtyManuallySet = true;
			
		}

		/// <summary>
		/// Stores a value that indicates whether the <c>VendorDistributionPoleRemedyEntity</c> is to be deleted.
		/// </summary>
		private bool prop_IsMarkedToDelete;
		
		/// <summary>
		/// Gets or Sets a value that specifies whether <c>VendorDistributionPoleRemedyEntity</c>'s data is to be removed from the database.
		/// <para> </para>
		/// <c>True</c> deletes the VendorDistributionPoleRemedy data.
		/// </summary>
		/// <remarks>Determines if a persist command (calling VendorDistributionPoleRemedyFactory's <c>Save()</c>) will DELETE the Entity's
		/// corresponding record in the database. For more information, see how
		/// <see cref="Classes.Factories.VendorDistributionPoleRemedyFactory.Save(Classes.Entities.VendorDistributionPoleRemedyEntity, bool)" /> works.
		/// </remarks>
		/// <value><c>VendorDistributionPoleRemedyEntity</c>'s deletion mark. <c>True</c> to delete; <c>false</c> otherwise.</value>
		[DataMember(), System.ComponentModel.Bindable(false), System.ComponentModel.Browsable(false)]
		public bool IsMarkedToDelete
		{
			get
			{
				return prop_IsMarkedToDelete;
			}
			set
			{
				prop_IsMarkedToDelete = value;
			}
		}

		/// <summary>
		/// Gets a unique checksum for <c>VendorDistributionPoleRemedyEntity</c>, calculated from its current property values.
		/// </summary>
		/// <remarks>
		/// <para>This property creates a checksum for <c>VendorDistributionPoleRemedyEntity</c>'s values by calling
		/// <see cref="PolePosition.v3.EntityLibrary.Entity.MakeHash" />, and sending it every column property's values, except for Checksum,
		/// the Primary Key, and any <c>null</c> properties.
		///</para>
		/// <para>The checksum is stored in the database along with the rest of <c>VendorDistributionPoleRemedyEntity</c>'s values when it is
		/// created or modified. Then, whenever <c>VendorDistributionPoleRemedyEntity</c> is loaded from the database, a new checksum is calculated
		/// on the loaded values and compared to the stored checksum (see <see cref="LoadFromDataRow(System.Data.DataRow, bool)" />).
		/// Because the checksum is unique for a specified set of values, if the database values were modified by someone without proper
		/// authorization, the checksums will not match, and an <see cref="ProjectCommon2.Exceptions.EntityCheckSumSecurityException" />
		/// will be thrown.
		/// </para>
		/// </remarks>
		/// <value>String that uniquely identifies the contents of the Entity it belongs to.</value>
		[DataMember(), System.ComponentModel.Bindable(false), System.ComponentModel.Browsable(false)]
		public string CheckSum
		{
			get
			{
				System.Text.StringBuilder sb = new System.Text.StringBuilder();
				if (this.PoleFk != null) { sb.Append(this.PoleFk.ToString()); }
				if (this.RemedyStatusFK != null) { sb.Append(this.RemedyStatusFK.ToString()); }
				if (this.RemedyAssigned != null) { sb.Append(this.RemedyAssigned.ToString()); }
				if (this.RemedyResolvedDate != null) { sb.Append(this.RemedyResolvedDate.ToString()); }
				if (this.RemedyNotes != null) { sb.Append(this.RemedyNotes.ToString()); }
				if (this.RemedyLastAction != null) { sb.Append(this.RemedyLastAction.ToString()); }
				
				return MakeHash(sb.ToString());
			}
			private set
			{
					//Intentionally not implimented. Set is only available for serialization.
					//Due to reconstruction of the object upon deserialization in WCF this set
					//is called regardless of whether it is private. For this reason the method
					//contains no code nor a NotImplemented exception.
			}
		}
		
		/// <summary>
		/// Stores the string that represents the original checksum for <c>VendorDistributionPoleRemedyEntity</c>.
		/// </summary>
		private string prop_CheckSumOriginal = string.Empty;
		/// <summary>
		/// Gets or Sets the original checksum loaded from the database when <c>VendorDistributionPoleRemedyEntity</c> was first constructed.
		/// </summary>
		/// <remarks>Stored so that its value can be compared to the checksum in the database record when writing <c>VendorDistributionPoleRemedyEntity</c> 
		/// back to the database. When checksum verification is used, this comparison makes sure that <c>VendorDistributionPoleRemedyFactory</c> is writing to the correct, 
		/// and unmodified, record from which <c>VendorDistributionPoleRemedyEntity</c> was created.
		/// </remarks>
		/// <value>Original checksum value loaded from the database for <c>VendorDistributionPoleRemedyEntity</c>.</value>
		[DataMember(), System.ComponentModel.Bindable(false), System.ComponentModel.Browsable(false)]
		public string CheckSumOriginal
		{
			get
			{
				return prop_CheckSumOriginal;
			}
			set
			{
				prop_CheckSumOriginal = value;
			}
		}
		#endregion
		
	}
}

